<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Color Blocks</title>
    <style>
        body {
            margin: 0;
        }

        div {
            width: 250px;
            height: 100px;
            border: 5px solid #000;
            color: black;
            font-weight: bold;
            margin: 25px;
        }

        div#d1 {
            background-color: red;
            text-align: center;
            padding: 15px;
        }

        div#d2 {
            background-color: green;
            text-align: right;
            padding: 25px 50px 6px 6px;
        }

        div#d3 {
            background-color: blue;
            text-align: left;
            padding: 6px 6px 6px 50px;
        }

        div#d4 {
            background-color: yellow;
            text-align: center;
            padding: 50px;
        }

        p {
            background-color: #fff;
        }
    </style>
</head>
<body>
    <div id="d1">
        <p>DIV #1</p>
    </div>
    <div id="d2">
        <p>DIV #2</p>
    </div>
    <div id="d3">
        <p>DIV #3</p>
    </div>
    <div id="d4">
        <p>DIV #4</p>
    </div>
</body>
</html>
